package com.huike.xingxing.fragment;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.huike.xingxing.R;
import com.huike.xingxing.activity.AdvisoryActivity;
import com.huike.xingxing.activity.InformActivity;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;

public class DiscoverFragment extends BaseFragment {
    Context context;
    private LinearLayout ll_discover_advisory;
    private LinearLayout ll_discover_inform;
    @Override
    public void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        context = getActivity();
    }

    @Nullable
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View view = View.inflate(context, R.layout.discover, null);
        ll_discover_advisory = view.findViewById(R.id.ll_discover_advisory);
        ll_discover_inform = view.findViewById(R.id.ll_discover_inform);
        initClick();
        return view;
    }

    private void initClick() {
        ll_discover_advisory.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
               startActivity(new Intent(context, AdvisoryActivity.class));
            }
        });

        ll_discover_inform.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                startActivity(new Intent(context, InformActivity.class));

            }
        });
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
    }
}
